package com.mccrea.pattern.visitor;

import java.util.LinkedList;
import java.util.List;

/**
 * @Classname BusinessReport
 * @Description 员工报表类
 * @Date 2021/5/20 0020 14:20
 * @Created by Mccrea_Gao
 */
public class BusinessReport {

    private List<Staff> staffList = new LinkedList<>();

    public BusinessReport() {
        staffList.add(new Manager("经理 - A"));
        staffList.add(new Manager("经理 - B"));
        staffList.add(new Engineer("工程师 - A"));
        staffList.add(new Engineer("工程师 - B"));
        staffList.add(new Engineer("工程师 - C"));
        staffList.add(new Engineer("工程师 - D"));
    }

    /**
     * 展示报表
     * @param visitor 访问者
     */
    public void showReport(Visitor visitor) {
        staffList.forEach(s -> s.accept(visitor));
    }
}
